For PC file or files transferred in binary format using FTP, Programmer Studio also provides a fully featured hex editor. The hex editor is ideal for editing binary files as the contents of a file is displayed in both HEX and ASCII at the same time.
The hex editor display is very different from that of the code editor. The content of the open document is dynamically displayed in both HEX and ASCII formats, as two distinct columns each displaying 16 bytes from the file on each line.
The offset of each line from the start of the file is displayed on the left. The hex value of each byte is displayed using two hex digits to represent ASCII values from 0 to 255 (00 to FF) respectively. To enable the position of each hex digit pair, an additional gap is used to separate the first 8 bytes from the second 8 bytes. To the very right, the ASCII representation of the 16 byes is then displayed.
To open a file in the hex editor
From the File menu, select Open
Use the file dialog box to select the file name
From the Edit as drop-down, select Hex
Click Open.
For the two views of the file, hex and ASCII, the hex editor provides two input modes. After loading the file, the cursor is located in the ASCII section of the code editor. To switch between the ASCII and hex views in the file, press the Tab key.
You can edit the ASCII view of the file in exactly the same way as you use the code editor or any other Windows editor.
When editing the hex view of the file, new byte values are entered in pairs of hex characters 0-9 and A-F. The first character represents the upper 4 bits of the value; the second character represents the lower 4 bits of the value.
Tip |
You can press the cursor key instead of entering the second hex character to use the value 0. |
The hex editor supports the same ways of selecting text as the code editor, but with one difference. The current selection is displayed in both the hex and ASCII views.
The hex editor uses content coloring to reflect the type of changes that have been made to the current file. Using two alternative colors, the hex editor displays the bytes that have been inserted or overwritten.